<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page language="java" import="java.util.*" %>
<%@ page language="java" import="com.tangdi.production.mpapp.utils.WebPayServletUtil" %>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	request.setAttribute("on_back", "1");
	
	WebPayServletUtil payUtil = new WebPayServletUtil();
	//out.write(basePath);
	boolean ok = payUtil.validation(request,response);
	if(!ok){
		payUtil.toLoginPage(request, response);
	}
	request.setAttribute("title","我的收入");
%>
<!DOCTYPE html>
<html lang="zh">
<head>
<base href="<%=basePath%>">
<title>我的收入</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<meta name="description" content="Common form elements and layouts" />
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

<script type="text/javascript" src="js/jquery-1.7.1.min.js"
	charset="UTF-8"></script>

<script type="text/javascript" src="js/core-1.0.js" charset="UTF-8"></script>
<script type="text/javascript" src="js/webpay/date.js" ></script>
<script type="text/javascript" src="js/webpay/iscroll.js" ></script>
<link rel="stylesheet" href="ace_v1.3/assets/css/bootstrap.css" />

<link rel="stylesheet" href="ace_v1.3/assets/css/chosen.css" />
<link rel="stylesheet" href="ace_v1.3/assets/css/font-awesome.css" />

<!-- text fonts -->
<link rel="stylesheet" href="ace_v1.3/assets/css/ace-fonts.css" />
<link rel="stylesheet" href="css/webpay/my_income.css" />

<!-- ace styles -->
<link rel="stylesheet" href="ace_v1.3/assets/css/ace.css"
	class="ace-main-stylesheet" id="main-ace-style" />
<link href="css/webpay/common.css" rel="stylesheet" type="text/css" /> 
<!--[if lte IE 9]>
			<link rel="stylesheet" href="ace_v1.3/assets/css/ace-part2.css" class="ace-main-stylesheet" />
		<![endif]-->

<!--[if lte IE 9]>
		  <link rel="stylesheet" href="ace_v1.3/assets/css/ace-ie.css" />
		<![endif]-->



<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

<!--[if lte IE 8]>
		<script src="ace_v1.3/assets/js/html5shiv.js"></script>
		<script src="ace_v1.3/assets/js/respond.js"></script>
		<![endif]-->
<jsp:include page="../plug/head-include.jsp" />
<script src="js/webpay/my_income.js"></script>
<script type="text/javascript">
</script>
<style type="text/css">
.sub-menu-box{
	display: none;
}
.kbtn{
	border: 1px solid gray;
}
input.kbtn {
	font-size: 14px !important;
}
button.btn{
	font-size: 16px !important;
	width: 50px;
	padding: 5px 0 !important;
}
.date-box *{
}
</style>

</head>
<body class="no-skin">
	<!-- #section:basics/navbar.layout -->
	<jsp:include page="../plug/title.jsp" />

	<!-- /section:basics/navbar.layout -->
	<div class="main-container" id="main-container">

		<!-- #section:basics/sidebar -->
		<!-- /section:basics/sidebar -->
		<div class="main-content">
			<div class="main-content-inner">
				<!-- #section:basics/content.breadcrumbs -->
				<!-- /section:basics/content.breadcrumbs -->
				<div class="page-content">
					<!-- #section:settings.box -->
					<!-- <div class="page-header">
						<h1>
							Form Elements <small> <i
								class="ace-icon fa fa-angle-double-right"></i> Common form
								elements and layouts
							</small>
						</h1>
					</div>
					 -->
					<!-- <div class="row">
						<div class="col-xs-12">安徽大智梦信息科技有限公司</div>
					</div> -->
					<!-- <div class="col-sm-8 col-xs-12 col-sm-offset-2 align-center">
						<img src="images/user/logo.png" style="height: 45px;margin: 10px 0 15px 0;">
					</div> -->
					
					
					
					<div class="col-sm-8 col-xs-12 col-sm-offset-2 date-box" style="text-align: right;padding: 0px;">
						 <input id="beginTime"  class="kbtn" name="STARTDATE"/>
						 至
						 <input  id="endTime" class="kbtn" name="ENDDATE"/>
						 
						 <button class="btn btn-info" type="button"
							 onclick="loadShrList()" >
							 查看
						</button>
					</div>
					<div class="col-sm-8 col-xs-12 col-sm-offset-2 space-1">
					
					</div>
					<div id="SHR_TYPE_1" class="col-sm-8 col-xs-12 is-click menu-option col-sm-offset-2">
						<div class="ace-icon icon-activates left">
							<img src="images/user/shr_tuiguang.png">
						</div>
						<div class="menu-body clear-padding">
							<div class="col-xs-12 clear-padding">
								<div class="left">
									推广佣金
								</div>
								<div class="right">
									<!-- <div class="left describe" valueOf="{USER_CNT} 人 \&nbsp;">
										0 人
									</div> -->
									
									<!-- <div class="left describe" valueOf="{CUST_LEVEL}" init-format="doLevel('{value}')""> -->
									<div class="left describe" valueOf="{SHR_CNT}" init-format="doAmtValue('{value}',1,-1,0)">
										0.00
									</div>
									<img src="images/arrow.png" class="arrow">
								</div>
							</div>
						</div>
					</div>
					<div class="sub-menu-box col-sm-8 col-xs-12 col-sm-offset-2" ref="SHR_TYPE_1">
						<div class="col-xs-12 is-click menu-option sub-menu SHR_LEVEL_1" >
							<div class="menu-body clear-padding">
								<div class="col-xs-12 clear-padding">
									<div class="left">
										一级推广
									</div>
									<div class="right">
										<!-- <div class="left describe" valueOf="{USER_CNT_1} 人">
											0 人
										</div> -->
										<div class="left describe" valueOf="{SHR_LEVEL_1}" init-format="doAmtValue('{value}',1,1)">
											0.00 元
										</div>
										<img src="images/arrow.png" class="arrow">
									</div>
								</div>
							</div>
						</div>
						<div class="col-xs-12 is-click menu-option sub-menu SHR_LEVEL_2" >
							<div class="menu-body clear-padding">
								<div class="col-xs-12 clear-padding">
									<div class="left">
										二级推广
									</div>
									<div class="right">
										<!-- <div class="left describe" valueOf="{USER_CNT_2} 人">
											0 人
										</div> -->
										<!-- <div class="left describe" valueOf="{CUST_LEVEL}" init-format="doLevel('{value}')""> -->
										<div class="left describe" valueOf="{SHR_LEVEL_2}" init-format="doAmtValue('{value}',1,2)">
											0.00  元
										</div>
										<img src="images/arrow.png" class="arrow">
									</div>
								</div>
							</div>
						</div>
						<div class="col-xs-12 is-click menu-option sub-menu SHR_LEVEL_3" >
							<div class="menu-body clear-padding">
								<div class="col-xs-12 clear-padding">
									<div class="left">
										三级推广
									</div>
									<div class="right">
										<!-- <div class="left describe" valueOf="{USER_CNT_3} 人">
											0 人
										</div> -->
										<!-- <div class="left describe" valueOf="{CUST_LEVEL}" init-format="doLevel('{value}')""> -->
										<div class="left describe" valueOf="{SHR_LEVEL_3}" init-format="doAmtValue('{value}',1,3)">
											0.00  元
										</div>
										<img src="images/arrow.png" class="arrow">
									</div>
								</div>
							</div>
						</div>
					</div>
					<div id="SHR_TYPE_2" class="col-sm-8 col-xs-12 is-click menu-option col-sm-offset-2">
						<div class="ace-icon icon-activates left">
							<img src="images/user/shr_tran.png">
						</div>
						<div class="menu-body clear-padding">
							<div class="col-xs-12 clear-padding">
								<div class="left">
									交易分润
								</div>
								<div class="right">
									<div class="left describe" valueOf="{SHR_CNT}" init-format="doAmtValue('{value}',2,-1,0)">
										0.00  元
									</div>
									<img src="images/arrow.png" class="arrow">
								</div>
							</div>
						</div>
					</div>
					
					<div class="sub-menu-box col-sm-8 col-xs-12 col-sm-offset-2" ref="SHR_TYPE_2">
						<div class="col-xs-12 is-click menu-option sub-menu SHR_LEVEL_1" >
							<div class="menu-body clear-padding">
								<div class="col-xs-12 clear-padding">
									<div class="left">
										直接分润
									</div>
									<div class="right">
										<!-- <div class="left describe" valueOf="{CUST_LEVEL}" init-format="doLevel('{value}')""> -->
										<div class="left describe" valueOf="{SHR_LEVEL_1}" init-format="doAmtValue('{value}',2,1)">
											0.00  元
										</div>
										<img src="images/arrow.png" class="arrow">
									</div>
								</div>
							</div>
						</div>
						<div class="col-xs-12 is-click menu-option sub-menu SHR_LEVEL_2" >
							<div class="menu-body clear-padding">
								<div class="col-xs-12 clear-padding">
									<div class="left">
										团队分润
									</div>
									<div class="right">
										<!-- <div class="left describe" valueOf="{CUST_LEVEL}" init-format="doLevel('{value}')""> -->
										<div class="left describe" valueOf="{SHR_LEVEL_2}" init-format="doAmtValue('{value}',2,2)">
											0.00  元
										</div>
										<img src="images/arrow.png" class="arrow">
									</div>
								</div>
							</div>
						</div>
					</div>
					
					<div id="SHR_TYPE_0" class="col-sm-8 col-xs-12 is-click menu-option col-sm-offset-2">
						<div class="ace-icon icon-activates left">
							<img src="images/user/shr_cnt.png">
						</div>
						<div class="menu-body clear-padding">
							<div class="col-xs-12 clear-padding">
								<div class="left">
									收入合计
								</div>
								<div class="right">
									<div class="left describe" valueOf="{SHR_CNT}" init-format="doAmtValue('{value}',0,-1,0)">
										0.00  元
									</div>
									<img src="images/arrow.png" class="arrow">
								</div>
							</div>
						</div>
					</div>
					
					<div class="sub-menu-box col-sm-8 col-xs-12 col-sm-offset-2" ref="SHR_TYPE_0">
						<div class="col-xs-12 is-click menu-option sub-menu SHR_LEVEL_1" >
							<div class="menu-body clear-padding">
								<div class="col-xs-12 clear-padding">
									<div class="left">
										直接收入
									</div>
									<div class="right">
										<!-- <div class="left describe" valueOf="{CUST_LEVEL}" init-format="doLevel('{value}')""> -->
										<div class="left describe" valueOf="{SHR_LEVEL_1}" init-format="doAmtValue('{value}',0,1)">
											0.00  元
										</div>
										<img src="images/arrow.png" class="arrow">
									</div>
								</div>
							</div>
						</div>
						
						<div class="col-xs-12 is-click menu-option sub-menu SHR_LEVEL_2" >
							<div class="menu-body clear-padding">
								<div class="col-xs-12 clear-padding">
									<div class="left">
										团队收入
									</div>
									<div class="right">
										<!-- <div class="left describe" valueOf="{CUST_LEVEL}" init-format="doLevel('{value}')""> -->
										<div class="left describe" valueOf="{SHR_LEVEL_2}" init-format="doAmtValue('{value}',0,98)">
											0.00 元
										</div>
										<img src="images/arrow.png" class="arrow">
									</div>
								</div>
							</div>
						</div>
						
						<div class="col-xs-12 is-click menu-option sub-menu SHR_LEVEL_2" >
							<div class="menu-body clear-padding">
								<div class="col-xs-12 clear-padding">
									<div class="left">
										当前余额
									</div>
									<div class="right">
										<!-- <div class="left describe" valueOf="{CUST_LEVEL}" init-format="doLevel('{value}')""> -->
										<div class="left describe" valueOf="{CASH_AMT}" init-format="doAmtValue('{value}',3,-1)">
											0.00 元
										</div>
										<img src="images/arrow.png" class="arrow">
									</div>
								</div>
							</div>
						</div>
					</div>
					
					<div id="AGENT_CUST_CNT" class="col-sm-8 col-xs-12 is-click menu-option col-sm-offset-2">
						<div class="ace-icon icon-activates left">
							<img src="images/user/user_info.png">
						</div>
						<div class="menu-body clear-padding">
							<div class="col-xs-12 clear-padding">
								<div class="left">
									团队规模
								</div>
								<div class="right">
									<div class="left describe" valueOf="{CUST_CNT} 人" init-format="doCustValue('{value}',-1,0)">
										0 人
									</div>
									<img src="images/arrow.png" class="arrow">
								</div>
							</div>
						</div>
					</div>
					
					<div class="sub-menu-box col-sm-8 col-xs-12 col-sm-offset-2" ref="AGENT_CUST_CNT">
						<div class="col-xs-12 is-click menu-option sub-menu" >
							<div class="menu-body clear-padding">
								<div class="col-xs-12 clear-padding">
									<div class="left">
										普通商户
									</div>
									<div class="right">
										<!-- <div class="left describe" valueOf="{CUST_LEVEL}" init-format="doLevel('{value}')""> -->
										<div class="left describe" valueOf="{CUST_CNT_0} 人" init-format="doCustValue('{value}',0)">
											0 人
										</div>
										<img src="images/arrow.png" class="arrow">
									</div>
								</div>
							</div>
						</div>
						
						<div class="col-xs-12 is-click menu-option sub-menu" >
							<div class="menu-body clear-padding">
								<div class="col-xs-12 clear-padding">
									<div class="left">
										VIP商户
									</div>
									<div class="right">
										<!-- <div class="left describe" valueOf="{CUST_LEVEL}" init-format="doLevel('{value}')""> -->
										<div class="left describe" valueOf="{CUST_CNT_1} 人" init-format="doCustValue('{value}',1)">
											0 人
										</div>
										<img src="images/arrow.png" class="arrow">
									</div>
								</div>
							</div>
						</div>
						
					</div>
					
					<!-- /.page-header -->
				</div>
				<!-- /.page-content -->
			</div>
		</div>
		<!-- /.main-content -->

		<!-- /.main-container -->
	</div>
<div id="datePlugin"></div>
<!--效果html结束-->
<div class="clear"></div>
	<script type="text/javascript">
		$('#beginTime').date();
		$('#endTime').date();
		$('#beginTime').val(today());
		$('#endTime').val(ytoday());
		
		loadShrList();
		
		/**
		*amt 金额
		*accType 记账类型 -1:所有 ;0:收入;1:拓展分润;2:交易分润;3:提现
		*fenrunType 分润类型 -1:所有;1:直接分润;2:二级分润；3：三级分润;98:非直接分润的团队分润（二、三级分润）
		*/
		function doAmtValue(amt,accType,fenrunType,isClick){
			if(amt == '0'){
				amt = "0.00";
			}
			var value = "";
			var url = "user/shr_list.jsp?STARTDATE=" + $('#beginTime').val() + "&ENDDATE=" + $('#endTime').val();
			url += "&ACC_TYPE=" + accType + "&FENRUN_TYPE=" + fenrunType;
			/* if(accType == 1){
				url += "&ACC_TYPE=040101";
			}else if(accType == 2){
				url += "&ACC_TYPE=040102";
			} */
			
			/* if(fenrunType == 1){
				url += "&FENRUN_TYPE=1";
			}else if(fenrunType == 2){
				url += "&FENRUN_TYPE=2";
			}else if(fenrunType == 3){
				url += "&FENRUN_TYPE=3";
			} */
			
			amt += "";
			try {
				amt = amt.substr(0,amt.indexOf(".")+3)
			} catch (e) {
				amt = amt;
			}
			//不可点击
			if(isClick === 0){
				return amt + " 元" ;
			}
			// 3 是提现记录查询
			if(amt == "0.00" && accType != "3"){
				value = amt + " 元";
			}else{
				value = "<a href='"+url+"'>" + amt + " 元</a>";
			}
			return value;
		}
		
		function doCustValue(val,type,isClick){
			if(val > 0 && isClick !== 0){
				var url = "user/cust_list.jsp?BUY_TYPE="+type;
				val = "<a href='"+url+"'>" + val + "</a>";
				return val;
			}
			return val;
		}
	</script>
	 <!-- <script type="text/javascript" src="js/webpay/dial.js" charset="UTF-8"></script>
 -->	<!-- basic scripts -->
</body>
</html>